# 导包
import requests

from untils.SendMethod import SendMethod


class Event:
    def __init__(self):
        self.url = "http://127.0.0.1:8000"

    # 添加发布会
    def add_event(self, body):
        url = self.url + "/api/add_event/"
        return SendMethod.send_method("post", url, data=body)

    # 查询发布会
    def get_event(self, params):
        url = self.url + "/api/get_event_list/"
        return SendMethod.send_method("get", url, params=params)




if __name__ == '__main__':
    #  请求体
    body = {
        "eid": "7116523",
        "name": "天天开心发布会",
        "limit": "20",
        "status": "1",
        "address": "武汉源码时代",
        "start_time": "2022-07-26"
    }
    print(Event().add_event(body))
    parmas = {
        "eid": "7116523",
        "name": "天天开心发布会"
    }
    print(Event().get_event(parmas))
